{% extends 'news/base.html' %}

{% block titleBlock %}
    用户概况
{% endblock %}

{% block scriptBlock %}
    <link rel="stylesheet" type="text/css" href="../../static/news/css/jquery.pagination.css">
    <script type="text/javascript" src="../../static/news/js/other.js"></script>
    <script type="text/javascript" src="../../static/news/js/jquery.pagination.min.js"></script>
{% endblock %}

{% block contentBlock %}
    <div class="user_menu_con fl">
        <div class="user_center_pic">
            <img src={% if data.other_user.avatar_url %}
                {{ data.other_user.avatar_url }}
            {% else %}
                "../../static/news/images/user_pic.png"
            {% endif %} alt="用户图片">
        </div>
        <div class="user_center_name">{{ data.other_user.nick_name }}</div>

        <ul class="other_detail">
            <li>性 别：{% if data.other_user.gender == "MAN"  %}
                    男
                {% else %}
                    女
                {% endif %}
            </li>
            <li>签 名：{{ data.other_user.signature }}</li>
        </ul>
        <div class="focus_other">
            <a href="javascript:;" class="focus block-center" data-userid="{{ data.other_user.id }}" style="display: {% if data.is_followed %}none{% else %}block{% endif %}">关注</a>
            <a href="javascript:;" class="focused block-center" data-userid="{{ data.other_user.id }}" style="display: {% if data.is_followed %}block{% else %}none{% endif %}"><span class="out">已关注</span><span class="over">取消关注</span></a>
        </div>
    </div>
    <div class="user_con fr">
        <div class="other_collect">
            <h3>{% if data.other_user.gender == "MAN"  %}
                    他
                {% else %}
                    她
                {% endif %}
                的 文 章
            </h3>
            <ul class="article_list">
                {% for news in data.news_list %}
                    <li>
                        <a href="/news/{{ news.id }}">{{ news.title }}</a>
                        <span>{{ news.create_time }}</span>
                    </li>
                {% endfor %}
            </ul>
            <div id="pagination" class="page"></div>
            <script>
                $(function(){
                    $("#pagination").pagination({
                        currentPage: {{ data.current_page }},
                        totalPage: {{ data.total_page }},
                        callback: function(current) {
                            window.location.href = '/other/' + {{ data.other_user.id }} + '?p=' + current
                        }
                    });
                });
            </script>
        </div>
    </div>
{% endblock %}

{% block rankBlock %}
{% endblock %}